package cn.iocoder.yudao.module.service.dal.mysql.stepconfig;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.service.dal.dataobject.stepconfig.StepConfigDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.service.controller.admin.stepconfig.vo.*;

/**
 * 步骤配置 Mapper
 *
 * @author 数创万维
 */
@Mapper
public interface StepConfigMapper extends BaseMapperX<StepConfigDO> {

    default PageResult<StepConfigDO> selectPage(StepConfigPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<StepConfigDO>()
                .eqIfPresent(StepConfigDO::getLabel, reqVO.getLabel())
                .eqIfPresent(StepConfigDO::getSceneId, reqVO.getSceneId())
                .eqIfPresent(StepConfigDO::getContent, reqVO.getContent())
                .eqIfPresent(StepConfigDO::getType, reqVO.getType())
                .eqIfPresent(StepConfigDO::getNextStepId, reqVO.getNextStepId())
                .betweenIfPresent(StepConfigDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(StepConfigDO::getId));
    }

}